package com.allwees.bs.c.module.order.context.bo;

import com.allwees.bs.c.module.user.entity.UserCouponEntity;
import com.allwees.bs.c.module.user.entity.UserPromoLogEntity;
import com.allwees.bs.core.model.user.constant.ECouponDefType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserCouponBo {

    private BigDecimal maxDeductAmt;

    private BigDecimal faceValue;

    private ECouponDefType couponType;

    private Date overdueTime;

    /** 值 text **/
    private String valueText;

    /** name **/
    private String name;

    public UserCouponBo(UserCouponEntity userCoupon) {
        this.faceValue = userCoupon.getFaceValue();
        this.maxDeductAmt = userCoupon.getMaxDeductAmt();
        this.couponType = userCoupon.getCouponType();
        this.overdueTime = userCoupon.getOverdueTime();
        this.valueText = userCoupon.getValueText();
        this.name = userCoupon.getCouponName();
    }

    public UserCouponBo(UserPromoLogEntity userPromoLog) {
        this.faceValue = userPromoLog.getValue();
        this.maxDeductAmt = userPromoLog.getMaxDeductAmt();
        this.couponType = ECouponDefType.RATE;
        this.valueText = userPromoLog.getValueText();
        this.valueText = userPromoLog.getValueText();
        this.name = userPromoLog.getName();
    }
}
